package com.daatak.finance.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.daatak.finance.domain.FinancialProductObject;
import com.daatak.finance.domain.RateBandObject;
import com.daatak.finance.domain.RateCardObject;

@Repository
@Transactional
public class FinancialsDao implements FinancialsDaoI {

	@Autowired
	 SessionFactory sessionFactory;
	 
	 public void setSessionFactory(SessionFactory sessionFactory) {
		 this.sessionFactory=sessionFactory;
	    }
	public void createRateCard(RateCardObject rateCard) {
		// TODO Auto-generated method stub
		
	}
	public List<RateCardObject> getRateCardList() {
		// TODO Auto-generated method stub
		return null;
	}
	public List<RateBandObject> getRateBandByRateCardId(Integer rateCardId) {
		// TODO Auto-generated method stub
		return null;
	}
	public void createRateBand(RateBandObject rateBand) {
		// TODO Auto-generated method stub
		
	}
	public String createFinancialProduct(FinancialProductObject financialProduct) {
		// TODO Auto-generated method stub
		return null;
	}
	public RateCardObject getRateCardById(Integer rateCardId) {
		// TODO Auto-generated method stub
		return null;
	}
	public FinancialProductObject loadFinancialProduct(Integer id) {
		// TODO Auto-generated method stub
		return null;
	}
	public List<RateBandObject> listRateBand() {
		// TODO Auto-generated method stub
		return null;
	}
	public int assignRateBandToRateCard(String[] rateCardId, String[] rateBandId) {
		// TODO Auto-generated method stub
		return 0;
	}
	public FinancialProductObject findById(Integer id) {
		// TODO Auto-generated method stub
		return (FinancialProductObject)getSession().get(FinancialProductObject.class, id);
	}
	public RateCardObject rateCardById(Integer rateCardId) {
		// TODO Auto-generated method stub
		return null;
	}
	public List<RateCardObject> listRateCards(Integer financialProductId) {
		// TODO Auto-generated method stub
		return null;
	}
	public List<RateBandObject> listRateBand(Integer rateCardId,
			Integer financialProductId) {
		// TODO Auto-generated method stub
		return null;
	}
	public List<FinancialProductObject> list() {
		// TODO Auto-generated method stub
		
		return getSession().createQuery("from FinancialProductObject").list();
		
	}
	
	public Session getSession(){
		return sessionFactory.getCurrentSession();
	}
			
		    
	   
	    
}
